import com.mysql.jdbc.jdbc2.optional.MysqlDataSource;

import javax.sql.DataSource;
import java.sql.Connection;
import java.sql.SQLException;
import java.util.HashSet;
import java.util.Scanner;

public class Demo3 {
    public static void main(String[] args) {
        //力扣 宝石与石头
        HashSet<Character> set = new HashSet<>();
        String jewels = "abcde";
        char[] c = jewels.toCharArray();
        for(char c2:c) {
            set.add(c2);
        }
        String stones = "afdsa";
        char[] c3 = stones.toCharArray();
        int count = 0;
        for (char c4:c3) {
            if(set.contains(c4)) {
                count++;
            }
        }
//        return count;
    }

    public static void main1(String[] args) throws SQLException {
        Scanner scanner = new Scanner(System.in);

        while(true) {
            System.out.println("请选择你的操作");
            System.out.println("1.查看数据");
            System.out.println("2.添加数据");
            System.out.println("3.删除数据");
            System.out.println("4.修改数据");
            int n = scanner.nextInt();
            switch(n) {
                case 1:
                    new Select();
                    break;
                case 2:
                    System.out.println("请输入id");
                    int id = scanner.nextInt();
                    System.out.println("请输入名字");
                    String name = scanner.next();
                    new Insert(id,name);
                    break;
                case 3:

                    break;
                case 4:

                    break;
                default:
                    System.out.println("输入错误");
            }
        }
    }
}
